package com.trainoo.exception;

/**
 * Created by Administrator on 2017/6/5.
 */

import com.trainoo.domain.ResultEnum;

/**
 * 继承RuntimeException原因是因为，spring只会对RuntimeException进行事务回滚，如果继承的事Exception的话，是不会进行事物回滚的
 */
public class GirlsException extends RuntimeException {

    private Integer code;

    public GirlsException(ResultEnum result) {
        super(result.getMsg());
        this.code = result.getCode();
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
}
